home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c,comp.unix.shell,comp.unix.programmer,comp.unix.questions
- Path: tmai.com!usenet
- From: sridhar_panchapakesan@tmai.com (Sridhar Panchapakesan)
- Subject: 'getopt' problem..
- X-Nntp-Posting-Host: 205.159.65.69
- Message-ID: <SRIDHAR_PANCHAPAKESAN.96Feb5162934@compton.tmai.com>
- Sender: usenet@tmai.com (usenet acct for news)
- Organization: Technology Modeling Associates, Inc.
- Date: Tue, 6 Feb 1996 00:29:33 GMT
-
- I am trying to use 'getopt' to read a quoted string as options for a
- program. It works fine when I try it from a shell (csh) but when I try
- running it from a script using 'exec' it does not accept the entire the
- entire quoted string as the option.
-
- e.g. ( test is the program name)
- % test -f "-g -o 5" in.txt
- ( getopt works fine. The string "-g -o 5" is read correctly into
- optargs. Note that I have to use '-' (dash) in the string as a
- requirement of the program itself.)
-
- However when I try it from the script file:
-
- exec test -f "\"-g -o 5\"" in.txt
-
- The getopt only recognizes "-g as the option for -f instead of "-g -o
- 5".
-
- I would appreciate any help in this area..
-
- - Sridhar.
-
-
- -----------------------------------------------------------------------------
- sridhar panchapakesan, member of technical staff
- e-mail: sridhar_panchapakesan@tmai.com
- phone : (415) 856-8862 x279 fax : (415) 856-8860
- technology modeling associates, inc. (http://www.tmai.com)
- __o
- _ \<,_
- (*)/ (*)
- ----- Save Earth
- -----------------------------------------------------------------------------
- --
-
- -----------------------------------------------------------------------------
- sridhar panchapakesan, member of technical staff
- e-mail: sridhar_panchapakesan@tmai.com
- phone : (415) 856-8862 x279 fax : (415) 856-8860
- technology modeling associates, inc. (http://www.tmai.com)
- __o
- _ \<,_
- (*)/ (*)
- ----- Save Earth
- -----------------------------------------------------------------------------
-